//package com.adopapa.nezhacloud.authc.conf;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.crypto.password.PasswordEncoder;
//import org.springframework.security.web.SecurityFilterChain;
//
//@Configuration
////@EnableWebSecurity
//public class SecurityConfig  {
//
//	@Autowired
//	private PasswordEncoder passwordEncoder;
//
//	// 授权
//	@Bean
//	public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
////		http.authorizeHttpRequests(authorize -> authorize.requestMatchers("/login/**").permitAll()
////				.anyRequest().authenticated())
////		.userDetailsService(userDetailsService())
//		;
//
////        http.authorizeHttpRequests().antMatchers("/login").permitAll()
////                .antMatchers("/users/**", "/settings/**").hasAuthority("Admin")
////                .hasAnyAuthority("Admin", "Editor", "Salesperson")
////                .hasAnyAuthority("Admin", "Editor", "Salesperson", "Shipper")
////                .anyRequest().authenticated()
////                .and().formLogin()
////                .loginPage("/login")
////                    .usernameParameter("email")
////                    .permitAll()
////                .and()
////                .rememberMe().key("AbcdEfghIjklmNopQrsTuvXyz_0123456789")
////                .and()
////                .logout().permitAll();
//// 
////        http.headers().frameOptions().sameOrigin();
//		http.authorizeHttpRequests().requestMatchers("/**").permitAll()
////		.requestMatchers("/**").permitAll()
//		;
//
////		http.authorizeHttpRequests(authorize -> authorize //
////				
////				.requestMatchers("/*/login/login").permitAll());
//
//		return http.build();
//	}
//
//	// 认证
//	// 密码编码：PasswordEncoder
//
////	@Bean
////	public UserDetailsService userDetailsService() {
////	    //不对密码进行加密
////	    User.UserBuilder userBuilder = User.withDefaultPasswordEncoder();
////	    UserDetails user1 = userBuilder.username("user1") .password("password").roles("USER").build();
////	    UserDetails admin = userBuilder.username("admin") .password("password").roles("USER", "ADMIN").build();
////	    return new InMemoryUserDetailsManager(user1,admin);
////	}
//}
